loadList();
// content1();
//显示商品列表
async function loadList() {
	let pagesize = 20;
	let pagenum = 0;
	let uid = localStorage.getItem("uid");
	let params = {
		pagenum,
		pagesize,
		uid
	};
	let {
		data
	} = await axios.get(proudtListAPI, {
		params
	});
	console.log(data);
	productArr = data.data;
	console.log(productArr); //-> li
	//column1动态
	 let str="";

	 productArr.forEach((pObj)=>{
		 
     str+= `
			  <dl>
			  	<dt><img src="${pObj.pimg}"></dt>
			  	<dd>
			  		<span class="dz">配件8折</span>
			  		<div class="js">
			  			<h2>${pObj.pname}</h2>
			  			${pObj.pdesc}
			  		</div>
			  		<div class="column1-font">
			  			<span>售价：<i>${pObj.pprice}</i></span>
			  			<a href="shoping.html?pid=${pObj.pid}">立即购买&lt;</a>
			  		</div>
			  	</dd>
			  </dl>
			`
	 });
	 console.log(str);
	 let contentk = document.querySelector(".column1");
	 contentk.innerHTML = str;
	
	
	let content1 = productArr.map(
		(pObj) => `
			  <dl>
			  	<dt><img src="${pObj.pimg}"></dt>
			  	<dd>
			  		<span>新品</span>
			  		<p>${pObj.pdesc}</p>
			  		<a href="shoping.html?pid=${pObj.pid}">立即购买&lt;</a>
			  	</dd>
			  </dl>
			`
	);
	console.log(content1);
	let content3= document.querySelector(".content1");
	content3.innerHTML = content1.join("");
}

